package com.xr.redis.pubsub.service;

import com.xr.redis.pubsub.model.Message;

/**
 * @author Arnold Yand
 * @summary 发布订阅服务 适配器
 * @time 2018/8/9 17:50
 */
public interface IPubSubServiceAdapter {

  /**
   * 订阅频道
   * @throws Exception
   */
  void init() throws Exception;
  /**
   * 发布消息
   * @param channel
   * @param message
   * @throws Exception
   */
  void publish(String channel, Message message) throws Exception;

  /**
   * 订阅频道
   * @param channel
   * @throws Exception
   */
  void subscribe(String channel) throws Exception;

}
